package yunhe.servlet;

import yunhe.service.NewsServers;
import yunhe.service.impl.NewsServersImpl;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;


@SuppressWarnings("serial")
public class Search extends HttpServlet {
	
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		NewsServers ns=new NewsServersImpl();
		resp.setContentType("content='text/html;charset=UTF-8'");
		PrintWriter out=resp.getWriter();
		String text=req.getParameter("text");
		out.print(ns.seach(text)); //处理
	}
	
	
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doGet(req, resp);
	}
}
